package top.malaoshi.service;

import org.springframework.stereotype.Service;
import top.malaoshi.dao.NoticeMapper;
import top.malaoshi.entity.Notice;

import javax.annotation.Resource;
import java.util.UUID;

@Service
public class NoticeServiceImpl {
    @Resource
    private NoticeMapper dao;

    public Notice getNoticeById(String id){
        return dao.getNoticeById(id);
    }

    public void sendNotice(Notice notice) {
        String uuid= UUID.randomUUID().toString().replace("-","");
        notice.setId(uuid);
        dao.create(notice);
    }
}
